package com.godpaper.the3directs.model
{
	import com.godpaper.the3directs.busniess.factorys.ButtonFactory;
	import com.godpaper.the3directs.support.AStar.Grid;
	
	import de.polygonal.ds.Array2;
	import de.polygonal.ds.Graph;
	
	import jp.dip.hael.gameai.graph.GraphEx;

	public class BoardModel
	{
		// Singleton instance of BoardModel
		private static var instance:BoardModel;
		public function BoardModel(access:Private)
		{
			if (access != null){
				if (instance == null)
				{				
					instance = this;
				}
			}
			else{
				throw new Error( "BoardModel.SINGLETON_EXCEPTION", "@BoardModel" );
			}
		}
		
		/**
		 * 
		 * @return the Singleton instance of BoardModel
		 * 
		 */		
		public static function getInstance():BoardModel
		{
			if(instance == null)
			{
				instance = new BoardModel(new Private());
			}
			return instance;
		}
		
//--------------------------------------------------------------------------
//
//  Variables
//
//--------------------------------------------------------------------------			
		[Bindable]public var gameGraph:de.polygonal.ds.Graph = new Graph(ButtonFactory.MAX_GASKET_NUM);//mapping Gaskets gameGraph
		[Bindable]public var gamePosition:Array2 = new Array2(15,8);//mapping table(point,array)
		[Bindable]public var WITH_DEBUG:Boolean = true;//indicate whether this game with debug func.
		[Bindable]public var gasketsPosition:Array2 = new Array2(15,8);//mapping gaskets with chessboard;
		[Bindable]public var gameGraphRed:GraphEx = new GraphEx();//mapping red Pieces gameGraph
		[Bindable]public var gameGraphBlue:GraphEx = new GraphEx();//mapping blue Pieces gameGraph
		[Bindable]public var gameGridRed:Grid = new Grid(15,8);//for AStar pathFinding;
		[Bindable]public var gameGridBlue:Grid = new Grid(15,8);//for AStar pathFinding;
		[Bindable]public var gameGrid:Grid = new Grid(15,8);//for AStar pathFinding test;
	}
}
/**
 * Inner class which restricts contructor access to Private
 */
class Private 
{
	
}